| Total Complexity | 1 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { Controller, Get, Inject, UseGuards } from '@nestjs/common'; |
||
| 10 | |||
| 11 | @Controller('users') |
||
| 12 | @ApiTags('User') |
||
| 13 | @ApiBearerAuth() |
||
| 14 | @UseGuards(AuthGuard('bearer'), RolesGuard) |
||
| 15 | export class GetPhotographersAction { |
||
| 16 | constructor( |
||
| 17 | @Inject('IQueryBus') |
||
| 18 | private readonly queryBus: IQueryBus |
||
| 19 | ) {} |
||
| 20 | |||
| 21 | @Get('photographers') |
||
| 22 | @Roles(UserRole.PHOTOGRAPHER) |
||
| 23 | @ApiOperation({ summary: 'Get photographers' }) |
||
| 24 | public async index(): Promise<UserSummaryView> { |
||
| 25 | return await this.queryBus.execute(new GetUsersByRoleQuery(UserRole.PHOTOGRAPHER)); |
||
| 26 | } |
||
| 28 |